﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Styx.Common;

namespace FM
{
    public partial class FM_GUI : Form
    {
        public FM_GUI()
        {
            InitializeComponent();
        }

        private void FM_GUI_Load(object sender, EventArgs e)
        {
            FM_Settings.Instance.Load();
            Use_AoE.Checked = FM_Settings.Instance.Use_AoE;
            Use_AE.Checked = FM.FM_Settings.Instance.Use_AE;
            Min_AE.Value = new decimal(FM.FM_Settings.Instance.Min_AE);
            Use_CD.SelectedIndex = FM.FM_Settings.Instance.Use_CD;

        }

        #region AoE
        private void Use_AoE_CheckedChanged(object sender, EventArgs e)
        {
            if (Use_AoE.Checked == true)
            {
                FM_Settings.Instance.Use_AoE = true;
            }
            else
            {
                FM_Settings.Instance.Use_AoE = false;
                {
                    Use_AE.Checked = false;
                }
            }

        }


        private void Use_AE_CheckedChanged(object sender, EventArgs e)
        {
            if (Use_AE.Checked == true)
            {
                FM_Settings.Instance.Use_AE = true;
                { Use_AoE.Checked = true; }
            }
            else
            {
                FM_Settings.Instance.Use_AE = false;
            }
        }

        private void Min_AE_ValueChanged(object sender, EventArgs e)
        {
            FM.FM_Settings.Instance.Min_AE = (int)Min_AE.Value;
        }
        #endregion


        private void Use_CD_SelectedIndexChanged(object sender, EventArgs e)
        {
            FM.FM_Settings.Instance.Use_CD = (int)Use_CD.SelectedIndex;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FM_Settings.Instance.Save();
            Close();
        }

        private void toolTip1_Popup(object sender, PopupEventArgs e)
        {

        }

        private void FM_GUI_Load_1(object sender, EventArgs e)
        {

        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }
    }
}
